package com.ht.system.api;

import com.ht.common.core.constant.SecurityConstants;
import com.ht.common.core.constant.ServiceNameConstants;
import com.ht.common.core.domain.R;
import com.ht.system.api.dto.ChannelInfoDto;
import com.ht.system.api.factory.RemoteChannelInfoFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * 远程调用获取通道信息
 *
 * @author zmx
 */
@FeignClient(contextId = "remoteChannelInfoService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteChannelInfoFallbackFactory.class)
public interface RemoteChannelInfoService {
    @PostMapping("channelInfo/findByChannelCode/{channelCode}")
    R<ChannelInfoDto> findByChannelCode(@PathVariable("channelCode") String channelCode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("channelInfo/findByFieldCode/{fieldCode}")
    R<List<ChannelInfoDto>> findByFieldCode(@PathVariable("fieldCode") String fieldCode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
